﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using System.Runtime.Serialization;
using Newtonsoft.Json;
using NGinnBPM.Lib.Util;

namespace NGinnBPM.Lib.Operations
{

    [MessageContract]
    public class GetTaskInstanceInfo : TaskInstanceOperation
    {
        
    }

    [DataContract]
    public class ChildTaskInfo
    {
        [DataMember]
        public string TaskId { get; set; }
        [DataMember]
        public string InstanceId { get; set; }
        [DataMember]
        public NGinnBPM.Lib.Interfaces.TaskStatus Status { get; set; }
    }

    [MessageContract]
    public class GetTaskInstanceInfoResponse : OperationResult
    {
        [MessageBodyMember]
        [JsonConverter(typeof(TaskDataJsonConverter))]
        public Dictionary<string, object> Data { get; set; }
        [MessageBodyMember]
        public string TaskId { get; set; }
        [MessageBodyMember]
        public string TaskType { get; set; }
        [MessageBodyMember]
        public string ProcessDefinitionId { get; set; }
        [MessageBodyMember]
        public string ProcessInstanceId { get; set; }
        [MessageBodyMember]
        public string ParentTaskInstanceId { get; set; }
        [MessageBodyMember]
        public NGinnBPM.Lib.Interfaces.TaskStatus Status { get; set; }
        [MessageBodyMember]
        public DateTime EnabledDate { get; set; }
        [MessageBodyMember]
        public DateTime? FinishedDate { get; set; }
        [MessageBodyMember]
        public ChildTaskInfo[] ActiveChildTasks { get; set; }
    }
}
